package LocatorsOnPages;


import Tests.TestConditions;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;


public class SearchPage extends TestConditions {



    /*---------------constructor---------------------------------------------------------------*/
    public SearchPage (WebDriver driver)
    {
        this.driver = driver;

    }

    /*---------------locators---------------------------------------------------------------*/

    private By SearchBox = By.name("text");
    private By SearchButton = By.className("btn-link-i");
    private By NotebookItem = By.xpath("//div[4]/div/div[1]/div[1]/h3/a");
    private By NetBookItem = By.xpath("//div[4]/div/div/div[1]/div[1]/div[2]/div/div[2]/a");
    private By FirstItemInTheList = By.xpath("//div[1]/div[1]/div[1]/div[1]/div/div/div[3]/a");

    /*---------------end locators---------------------------------------------------------------*/


    /*---------------Actions---------------------------------------------------------------*/

    public void searchBox(String text){

        driver.findElement(SearchBox).sendKeys(text);

    }


    public void clickSearchButton(){

        driver.findElement(SearchButton).click();

    }


    public void clickNotebookItem(){

        driver.findElement(NotebookItem).click();

    }


    public void clickNetbookItem(){

        driver.findElement(NetBookItem).click();

    }


    public void clickFirstItemInTheList(){

        driver.findElement(FirstItemInTheList).click();

    }

     /*---------------End Actions---------------------------------------------------------------*/

}
